<?php
$screen = Blyn::app()->getCurrentNode()->getUIManager()->getCurrentScreen();
$searchStr = Yii::t('site','Search');
?>

<div class="row-fluid" style="margin-top: 15px">    
    <?php
    /** @var BootActiveForm $form */
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'searchForm',
        'type' => 'search',
        'htmlOptions' => array('class' => 'well span12'),
    ));
    ?>
    <?php echo $form->textFieldRow($model, 'searchText', array('class' => 'input', 'prepend' => '<i class="icon-search"></i>')); ?>

    <?php
    $searchBtn = $screen->getAjaxLink($searchStr, array('htmlOptions' => array('class' => 'btn')));
    /*
      $ajaxSubmitBtn = $screen->getAjaxLink(array('id' => 'joinSpace_search', 'label' => 'Search'), array(
      'ajaxOptions' => array('success' => "js:function(html)
      {
      $('#show_Space_list').html(html);
      }",
      'type' => 'post'),
      'htmlOptions' => array('class' => 'btn'),
      'ajaxView' => 'joinSpaceItemView'
      ));
     * 
     */
    /*
      $ajaxSubmitBtn = $screen->buildAjaxLink('joinSpaceSearch', 'Search', NULL, $ajaxViews,
      //array('replace' => "#show_Space_list",
      array('success' => "js:function(html)
      {
      $('#show_Space_list').html(html);
      }",
      'type' => 'post'), array('class' => 'btn'));
     * 
     */
    ?>
    <?php echo $searchBtn ?>
    <?php $this->endWidget(); ?>  
</div>

<div id="show_Space_list">
    <?php
    //$ajaxViews = array(array('ajaxView' => 'joinSpaceItemView'));
    if ($screen->isAjaxLinkClicked($searchStr)) {
        $screen->renderView('joinSpaceItemView');
    }
    ?>
</div>